package com.mars.quartz.scheduler.jobs;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class EmailJob implements Job {

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			
			//ApplicationContext springContext = (ApplicationContext) context.getScheduler().getContext().get("applicationContextKey");
			//System.out.println(springContext.getBean("quartz_dataSource"));
			System.out.print("邮件....."+ 
			new SimpleDateFormat("yyyy-MM-dd HH:MM:ss").format(new Date()) + 
			" == " + 
			context.getTrigger().getKey() + 
			" == " + 
			context.getJobDetail().getKey() + 
			"\n");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
